<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>编辑{$label}</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:url('admin/index/index')}">控制台</a>
            </li>
            <li>
                <a href="{:url('/admin/'.$route)}">{$label}列表</a>
            </li>
            <li class="active">
                <strong>编辑{$label}</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">

    </div>
</div>
<div class="wrapper wrapper-content animated ">
<div class="row">
    <div class="col-lg-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <!--<h5>All form elements <small>With custom checbox and radion elements.</small></h5>-->
            </div>
            <div class="ibox-content">
                <form method="post" class="form-horizontal" action="{:url('/admin/'.$route.'/'.$id)}">
                    {foreach $formFields as $v}
                    <div class="form-group"><label class="col-sm-2 control-label">{$translations[$v]['text']}</label>
                        <div class="col-sm-9">
                            <?php if(empty($translations[$v]['type'])){ ?>
                                <input type="text" name="{$v}" value="{$data[$v]}" class="form-control">
                            <?php }else{ ?>
                            {switch name="$translations[$v]['type']" }
                                {case value="status"}
                                    <select name="{$v}" class="form-control">
                                        {foreach $translations[$v]['label'] as $_k => $_x}
                                            <option value="{$_k}" {eq name="$data[$v]" value="$_k"} selected {/eq}>{$_x['text']}</option>
                                        {/foreach}
                                    </select>
                                {/case}
                                {case value="textarea"}
                                    <textarea name="{$v}" class="form-control">{$data[$v]}</textarea>
                                {/case}
                                {default /}配置错误
                            {/switch}
                            <?php } ?>
                            {notempty name="$translations[$v]['info']"}
                                <span class="help-block m-b-none">{$translations[$v]['info'] }                     {/notempty}
                        </div>
                    </div>
                    {/foreach}
                    <input type="hidden" name='_method' value="PUT" />
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <a class="btn btn-white" href="{:url('/admin/'.$route)}">取消并返回</a>
                            <button class="btn btn-primary" type="submit">确认添加</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</div>